package com.newgrand.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.newgrand.model.HrEpmMain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author: zhanglixin
 * @Data: 2022/9/3 14:10
 * @Description: TODO
 */
@Resource
@Mapper
public interface HrEpmMainMapper  extends BaseMapper<HrEpmMain> {

    @Select("SELECT * FROM (select hem.phid,fu.mobileno,hem.cno,hem.cname,hem.user_kd_openid \n" +
            "from hr_epm_main hem\n" +
            "left join fg3_user fu on hem.phid=fu.hrid " +
            "where ((hem.user_kd_openid is null or hem.user_kd_openid='') " +
            " and (fu.mobileno is not null or fu.mobileno!=''))) emp ${ew.customSqlSegment}")
    List<HrEpmMain> selectByMyWrapper(@Param(Constants.WRAPPER) Wrapper<HrEpmMain> userWrapper);

    @Select(" ${querysql} ")
    List<Map<String,Object>> dynamicSql(@Param("querysql") String querysql);
}
